# AUTHOR: DING
# -*- codeing = utf-8 -*-
# @Time: 2024/2/22 15:51
# @Author: 86139
# @Site: 
# @File: 11-conv.py
# @Software: PyCharm
# tensorboard --logdir=pytorch/logs --port=6007

import torch
import torch.nn as nn
import torch.nn.functional as F

input = torch.tensor([[1, 2, 0, 3, 1],
                      [0, 1, 2, 3, 1],
                      [1, 2, 1, 0, 0],
                      [5, 2, 3, 1, 1],
                      [2, 1, 0, 1, 1]])
input = torch.reshape(input, (1, 1, 5, 5))
filter = torch.tensor([[1, 2, 1],
                       [0, 1, 0],
                       [2, 1, 0]])
filter = torch.reshape(filter, (1, 1, 3, 3))
output = F.conv2d(input, filter)
output2 = F.conv2d(input, filter, stride=2)
output3 = F.conv2d(input, filter, padding=(1, 2))
print(output)
print(output2)
print(output3)
